package edu.zueb.sport.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author jasonfu
 * @date 2024/9/13 15:43
 */
@Slf4j
@Configuration
public class SportMvcConfig implements WebMvcConfigurer {

    @Autowired
    TraceInterceptor traceInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.info("SportMvcConfig|addInterceptors");
        registry.addInterceptor(traceInterceptor).addPathPatterns("/api/**");
    }
}
